<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./js/render.js"></script>
    <script>
      const vnode = h(
        "div",
        {
          class: "test",
        },
        [
          h("h2", { id: "nei" }, "我是h2"),
          h(
            "button",
            {
              onClick: e => {
                e.preventDefault();
                console.log("哈哈哈");
              },
            },
            "打印"
          ),
        ]
      );
      const vnode2 = h("div", { id: "xfy", class: "hhh" }, [
        h("h3", { id: "nei" }, "我是h3"),
        h(
          "button",
          {
            onClick: e => {
              e.preventDefault();
              console.log("hhh");
            },
          },
          "新node"
        ),
      ]);
      setTimeout(() => {
        patch(vnode, vnode2);
      });
      mount(vnode, document.getElementById("app"));
    </script>
  </body>
</html>
